
cc.Class({
    extends: cc.Component,

    properties: {
        red: {
            default: null,
            type: cc.Node
        },
        red_name: {
            default: null,
            type: cc.Label
        },
        red_cardnode: {
            default: [],
            type: cc.Node
        },
        blue: {
            default: null,
            type: cc.Node
        },
        blue_name: {
            default: null,
            type: cc.Label
        },
        blue_cardnode: {
            default: [],
            type: cc.Node
        }
    },
    onLoad: function () {
        var self = this;

        var deltaX = 400;
        var rx = self.red.x;
        var bx = self.blue.x;
        self.red.x = rx - deltaX;
        self.blue.x = bx + deltaX;
        self.red.runAction(cc.moveTo(0.1, rx, self.red.y));
        self.blue.runAction(cc.moveTo(0.1, bx, self.blue.y));

        var seq = cc.sequence(cc.delayTime(0.2), cc.moveBy(0.05, 0, 50), cc.moveBy(0.05, 0, -50), cc.moveBy(0.05, 0, 35), cc.moveBy(0.05, 0, -35));
        self.blue.runAction(seq);

        setTimeout(function () {
            network.start();
            self.node.destroy();
        }, 1.5 * 1000);
    },
    setData: function (data) {
        console.log(data);
    }
});
